home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr29 / fga_os2d.zip / FGA.TXT
Text File  |  1995-02-21  |  33KB  |  732 lines

  1.  
  2.                      ─────────────────────────────────────
  3.   ═══════════════════ The OS2DOS Frequently Given Answers ═══════════════════
  4.                      ─────────────────────────────────────
  5.  
  6.     A selection of some of the frequently asked questions from the
  7.     International FIDONET OS2DOS echo, and, more importantly, their
  8.     frequently given answers.  Preliminary version 0.01.  19950205.
  9.  
  10.   Introduction
  11.   ────────────
  12.  
  13.     The International FIDONET OS2DOS echo is one of a family of several
  14.     echoes on FIDONET dealing with OS/2.  OS2DOS deals specifically with
  15.     DOS and Windows programs running under OS/2, and anything to do with
  16.     OS/2's Virtual DOS Machines.
  17.  
  18.     The FIDONET OS/2 Echo Family are backboned in all zones, and should be
  19.     available from locally all around the world.  If you cannot find an
  20.     echo from the family, ask your sysop or your echomail feed.
  21.  
  22.     This selection of Frequently Given Answers is by no means exhaustive,
  23.     but is meant to cover some of the more popular topics that regularly
  24.     come up in the echo.
  25.  
  26.     Readers of the FGA are reminded to *ALWAYS READ THE OS/2 USER GUIDE*.
  27.     Neither the OS2 family of echoes, nor the FGA are meant as a
  28.     substitute for the user guide, and many topics that people regularly
  29.     ask about are in fact covered extensively in the user guide and the
  30.     on-line help for OS/2.    The manual *is* your friend.
  31.  
  32.     The OS2DOS FGA document is archived on DoNoR, one of the larger OS/2
  33.     sites in the United Kingdom.  It is available for File Request 24
  34.     hours per day, every day of the year as OS2D-FGA.ZIP from 2:440/4.0.
  35.  
  36.   Applications
  37.   ────────────
  38.  
  39.   ■ What sorts of DOS and DOS+Windows applications will work under OS/2 ?
  40.  
  41.     Almost all of them.  The exceptions are detailed in the next answer,
  42.     and are actually restricted to a couple of specialised areas, as you
  43.     will see.
  44.  
  45.  
  46.   ■ What sorts of DOS and DOS+Windows applications will not work under
  47.     OS/2 ?
  48.  
  49.     There are essentially two sorts of softwares that will, by design, not
  50.     work under OS/2.
  51.  
  52.     The first are those that attempt to write to the hard disc at a low
  53.     level, such as disc doctoring programs.  Low level writes to the hard
  54.     disc from Virtual DOS Machines under OS/2 are not allowed, because DOS
  55.     disc doctoring programs are written with the assumption that nothing
  56.     else will be be accessing the disc at the same time as they are.
  57.  
  58.     Since OS/2 is a multitasking system, this becomes a possibility.  DOS
  59.     disc doctoring programs could thus cause consistency problems leading
  60.     to severe filesystem corruption were they allowed to write to the disc
  61.     directly at a low level.
  62.  
  63.     Native OS/2 programs are allowed to write to the hard disc directly,
  64.     but they use OS/2 services (for which there are no DOS equivalents) to
  65.     negotiate obtaining exclusive access to the disc whilst doing so.
  66.  
  67.     The second sort of software that will not by design work under OS/2
  68.     are those softwares that use the VCPI standard for DOS extenders.
  69.  
  70.     VCPI is a dead standard, which died years ago.    No-one supports it
  71.     these days, and programs that use it will only work on raw DOS.  Most
  72.     DOS memory managers will prevent VCPI programs from running as well,
  73.     because VCPI demands total control of the entire machine.
  74.  
  75.     If you find that software that you have bought relies on VCPI, send it
  76.     back *directly to the manufacturer* demanding a full refund.  Don't
  77.     support authors of VCPI software by continuing to give them money.
  78.  
  79.     Programs that use the newer DPMI DOS extender standard will not have
  80.     any such trouble under OS/2, as DPMI programs do not require total
  81.     control over the entire machine.
  82.  
  83.  
  84.   ■ VxDs don't run under OS/2, do they ?
  85.  
  86.     No they do not.  VxDs are drivers for Windows that require the ability
  87.     to run in real mode when they start up.  OS/2 *always* runs the
  88.     Windows kernel in v8086 protected mode.  Running in real mode would
  89.     disable multitasking, and bypass all system protection, so OS/2 does
  90.     not support VxDs.
  91.  
  92.     Most VxDs are kludges, written to provide support for unusual devices
  93.     to DOS boxes within Windows.  Under OS/2, hardware support for unusual
  94.     devices in VDMs is provided by proper protected mode virtual and
  95.     physical device drivers, supplied by the manufacturer.  Check with
  96.     your manufacturer for native driver support.  All good manufacturers
  97.     can supply VDDs and PDDs for their hardware nowadays.
  98.  
  99.  
  100.   ■ AutoCAD for DOS doesn't work under OS/2!
  101.  
  102.     Oh yes it does.  AutoCAD uses the Phar Lap DOS extender.  Prior to
  103.     release 12c2 of AutoCAD, this DOS extender used VCPI.  Subsequent
  104.     releases of the Phar Lap DOS extender use DPMI, and work under OS/2.
  105.     AutoDesk has been supplying an update to the Phar Lap DOS extender
  106.     almost since that release of AutoCAD.  Call AutoDesk and ask for it.
  107.  
  108.     While you are talking to them, ask them whether they've finished a
  109.     native OS/2 version of AutoCAD yet.
  110.  
  111.  
  112.   ■ Microsoft Visual C++ for DOS doesn't work under OS/2!
  113.  
  114.     Oh yes it does.  Microsoft Visual C++ also uses the Phar Lap DOS
  115.     extender.  However, Microsoft's tech support runs true to form, and
  116.     only makes fixes for its software available under protest.    So your
  117.     best route is to obtain the fix from Phar Lap's BBS directly, or from
  118.     your nearest FIDONET site that is part of the Fernwood file
  119.     distribution system.
  120.  
  121.     The Phar Lap DOS extender bugfix cures the problem with the
  122.     command-line tools in MSVC++ and allows them to run properly.  The
  123.     Visual Workbench, however, uses a VxD as a back door into the
  124.     internals of the Windows kernel, allowing it to start up and control
  125.     DOS sessions under DOS+Windows, in particular for running NMAKE
  126.     "seamlessly".
  127.  
  128.     When you come to generate programs in Visual Workbench, when you
  129.     receive the error message that VWB could not run NMAKE, simply start
  130.     another VDM within OS/2, and run NMAKE from there.    You can even set
  131.     up a Workplace Shell program object to run NMAKE if you like.  VWB
  132.     will have created the makefile properly for you.  This has the
  133.     advantage of allowing you to compile and edit simultaneously, which
  134.     you normally cannot do with Visual Workbench.
  135.  
  136.     Just FYI, you are suffering from always having to play catch-up by
  137.     using MSVC++.  By past record, it is usually the last to adopt any
  138.     changes to the C++ language ("Not Invented At Microsoft"), and
  139.     bugfixes are rarely published ("Wait for the next version").  There
  140.     are far better C++ compilers available, such as Watcom C++ or Metaware
  141.     High C++, with much better update and bugfix policies.    Watcom C++ can
  142.     even cross-compile DOS+Windows programs from a native OS/2 hosted
  143.     environment.  But this is straying into the realms of the FIDONET
  144.     C_PLUSPLUS echo.
  145.  
  146.  
  147.   ■ Doom for DOS doesn't work under OS/2!
  148.  
  149.     Oh yes it does.  Unfortunately, ID Software suffers from the sort of
  150.     tunnel vision that afflicts most games software houses.  They like to
  151.     hit the hardware directly instead of using the device drivers.    ID
  152.     accesses the sound card directly, and doesn't quite get it right.
  153.     Under DOS, this is unnoticable.  Under OS/2, however, because of
  154.     multitasking the timing code goes wrong.  This causes problems, and
  155.     sends ID's code into a flat spin.
  156.  
  157.     To run any game that uses the ID Software game engine, such as
  158.     Doom or Heretic, switch the sound off and use the PC Speaker.
  159.  
  160.     If you find that this spoils your enjoyment of the game, send the game
  161.     back *directly to the manufacturer* asking for a full refund, and
  162.     explain that you find it unsatisfactory that their sound facilities
  163.     don't work in the OS/2 multitasking environment.
  164.  
  165.  
  166.   ■ I have a DOS application written by Borland.  When it starts I
  167.     get half a page of gibberish, then the VDM ends with a SYS3176.
  168.  
  169.     Borland's interpretation of the DPMI standard differs from that of
  170.     most other software manufacturers.    In particular, Borland's software
  171.     initialises DPMI in a way different to the way that most other people
  172.     do it.
  173.  
  174.     The rights and wrongs of it aside, the cure is easy.  Go to the VDM
  175.     settings for that session object and change DPMI_DOS_API from AUTO to
  176.     ENABLED.  This will work for any Borland application that uses the
  177.     Borland DPMI DOS extender (look for a DPMILOAD.EXE or RTM.EXE file).
  178.  
  179.  
  180.   ■ I cannot install my Borland DOS program as a program object on the
  181.     Workplace Shell desktop.  All of the buttons on the [Session] page of
  182.     the settings notebook are greyed out.
  183.  
  184.     This is an artifact of Borland's proprietary DPMI DOS extender.  Its
  185.     DOS extended programs are in the 16-bit New Executable EXE file
  186.     format, but they have a meaningless value in the "target operating
  187.     system" field in the executable file header.
  188.  
  189.     This means that when Workplace Shell comes to inspect the executable
  190.     file header to determine what sort of session it needs to start the
  191.     program in, it finds illegal values and becomes confused.
  192.  
  193.     The simple solutions are either to use a short batch file, or to use
  194.     "*" as the program name and "/C C:\BORDIR\BORPROG.EXE" as the program
  195.     parameters.
  196.  
  197.     By the way, this information is in the Borland manuals for all of the
  198.     individual Borland DOS products.  Why didn't you read the manual ?
  199.     The manual *is* your friend.
  200.  
  201.  
  202.   ■ I have a game that doesn't work properly under OS/2!
  203.  
  204.     Although it is not possible to provide a catch-all for DOS games
  205.     softwares (see the FGA for Doom for a note on the programming ethos of
  206.     some games software houses) some avenues to explore follow that often
  207.     yield results.
  208.  
  209.     Try the memory settings.  If the game says on the box that it requires
  210.     a minimum amount of extended memory, ensure that the extended memory
  211.     settings in the VDM settings dialogue are above that minimum.  Do the
  212.     same for expanded memory.
  213.  
  214.     If the expanded memory settings are set unreasonably high, and the
  215.     game still reports a problem with being unable to initialise expanded
  216.     memory, you may have a game written using VCPI.  Check the
  217.     documentation for this, and if it turns out to be so, return it
  218.     *directly to the manufacturer* asking for a full refund.
  219.  
  220.     Try the video settings.  Some games require unusual video modes.
  221.     Since the video hardware is virtualised in VDMs, you may be required
  222.     to alter the VIDEO_8514A_XGA_IOTRAP and VIDEO_RETRACE_EMULATION
  223.     settings in the VDM settings dialogue for that session.
  224.  
  225.     Incidentally, if you have not installed your video drivers properly in
  226.     the first place, DOS games will usually "discover" your error for you.
  227.  
  228.  
  229.   ■ My DOS comms application has lots of errors.  What can I do ?
  230.  
  231.     Really, this is one of the Frequently Given Answers in the FIDONET
  232.     OS2DOSBBS echo.  Very briefly: you need a proper buffering 16550 UART
  233.     when doing interrupt-driven comms, and you may also like to try Ray
  234.     Gwinn's SIO serial device drivers.
  235.  
  236.  
  237.   ■ My DOS comms application is dead slow/slows down other applications.
  238.     What can I do to make things faster ?
  239.  
  240.     This too is one of the FGAs in the FIDONET OS2DOSBBS echo.    However,
  241.     here is an example of how to tune TELIX, which may help.
  242.  
  243.     TELIX is a very poorly behaved application.  It polls the keyboard and
  244.     the comms port almost continuously, and so wastes a lot of valuable
  245.     CPU time that could be used more productively by other applications.
  246.     Installing OSTSR or OS2SPEED helps somewhat, because TELIX knows how
  247.     to perform DesqView timeslice release calls.  However, TELIX still
  248.     consumes a disproportionate amount of CPU time when doing file
  249.     transfers.
  250.  
  251.     To reduce the impact of TELIX on other applications, leave it idle and
  252.     offline, and bring up Pulse.  Gradually adjust the IDLE_SENSITIVITY
  253.     setting for the VDM running TELIX until Pulse falls to zero (which
  254.     will usually be around the 33 mark).  This is by no means perfect,
  255.     but is the best general rule of thumb for TELIX that there is.
  256.  
  257.     Of course, if you use TELIX, you might as well do the sensible thing
  258.     and upgrade to LiveWire for OS/2.  After doing so, you'll realise just
  259.     how bad TELIX really was.  Of course, native OS/2 comms softwares are
  260.     properly the subject of a different Frequently Given Answers document.
  261.  
  262.  
  263.   Utilities
  264.   ─────────
  265.  
  266.   ■ How do I start another session from within a VDM ?
  267.  
  268.     There are several utilities available to do this.
  269.  
  270.     JP Software's excellent 4DOS replacement command interpreter comes
  271.     complete with a START command, that mirrors most of the function of
  272.     the START command available at a native OS/2 command line.    The /DOS
  273.     switch, that is used to start VDMs, can take an optional argument to
  274.     specify the name of a file containing the VDM settings to use.
  275.  
  276.     Other utilities include STARTD, DSTART, and HSTART, which all behave
  277.     similarly to 4DOS' built-in START command, and all of which are widely
  278.     distributed on file sites across FIDONET.
  279.  
  280.  
  281.   ■ My software knows how to release timeslices to DesqView, but not
  282.     to OS/2.  What can I do ?
  283.  
  284.     There are two utilities available to convert DesqView timeslice
  285.     releases into OS/2 timeslice releases, namely OS2SPEED and OSTSR,
  286.     both of which are widely available on FIDONET OS/2 file sites.
  287.  
  288.     You can File Request OSTSR and its companion program OSTITLE from Jay
  289.     Clegg's home node, 1:360/12.0, as OSTSR12.ZIP (14Kb).  If you do,
  290.     please drop him a short note just to say hello as well.
  291.  
  292.  
  293.   ■ I've installed OS2SPEED, and 4DOS now causes my VDMs to abort!
  294.  
  295.     Really you should read the 4DOS on-line documentation, because this is
  296.     explained there.  4DOS is DesqView aware, and is fooled by OS2SPEED
  297.     into thinking that it is running under DesqView.  It attempts to hook
  298.     into DesqView, and goes haywire because it isn't actually there.  You
  299.     need to adjust the DVCleanup setting in your 4DOS.INI file.
  300.  
  301.     Now go and read 4DOS.DOC.  The manual *is* your friend.
  302.  
  303.  
  304.   ■ How do I defragment or repair my SuperFAT partitions under OS/2 ?
  305.  
  306.     If you want an OS/2 solution, there are SuperFAT defragmentation
  307.     utilities available for OS/2.  GammaTech sell a SuperFAT
  308.     defragmentation tool as part of their suite of disc maintenance
  309.     utilities.  The Graham Utilites apparently come with a SuperFAT
  310.     defragmenter.  SafePack for OS/2 is a SuperFAT defragmentation tool.
  311.  
  312.     As for DOS defragmentation utilities, there are two problems.
  313.  
  314.     The first is that DOS programs are not allowed to write to the hard
  315.     disc at a low level when run on OS/2, even though they are allowed to
  316.     read from it.  This means that DOS defragmentation utilities must be
  317.     run by booting from a DOS boot disc.  This is not such a major
  318.     problem.
  319.  
  320.     The second is that not many defragmentation utilities are aware of
  321.     extended attributes.  In SuperFAT partitions, the directory records
  322.     contain extra information for each file, pointing to its extended
  323.     attribute information.    Some defragmentation utilities, most notably
  324.     PC-Tools COMPRESS, will complain that extended attribute pointers are
  325.     actually "errors" in the filesystem, and will "fix" them by wiping
  326.     them completely.  This will cause severe problems.
  327.  
  328.     People have reported good results with Norton SpeedDisk, and the
  329.     DEFRAG utility that comes with Novell DOS.    However, it seems that
  330.     different versions of these softwares behave differently.  Certainly
  331.     their behaviour with respect to extended attributes is not guaranteed
  332.     by the manufacturers.
  333.  
  334.     It is wise *not* to run defragmentation utilities on a SuperFAT
  335.     partition if it is the OS/2 boot partition unless you are *sure* that
  336.     they will not zap EA pointers (or unless you have full backups),
  337.     because the Workplace Shell desktop depends heavily from EAs.
  338.  
  339.     By far the best solution is to make the OS/2 boot partition an HPFS
  340.     partition.    You won't need to run defragmentation software (you won't
  341.     be *able* to run *DOS* defragmentation softwares against an HPFS
  342.     partition), and in the event of an error HPFS will be more recoverable
  343.     than SuperFAT.
  344.  
  345.  
  346.   ■ What are 4DOS and 4OS2 anyway ?
  347.  
  348.     4DOS and 4OS2 are replacement command interpreters from JP Software,
  349.     that provide *many* features and improvements over the standard
  350.     command interpreters.  4DOS replaces COMMAND, and runs both on DOS and
  351.     in an OS/2 Virtual DOS Machine.  4OS2 is 4DOS' big brother, and
  352.     replaces CMD, the native command interpreter for OS/2.
  353.  
  354.     This FGA won't go on at length about the many improvements and
  355.     facilities available in 4DOS and 4OS2, because there is not the room.
  356.     Suffice it to say that they make whole piles of extra utilities
  357.     unnecessary, and make life a lot more pleasant for the command line or
  358.     batch file user.
  359.  
  360.     Both 4DOS and 4OS2 are discussed in the FIDONET 4DOS echo.    The author
  361.     hangs out there as well.  You can obtain 4DOS and 4OS2 from many
  362.     FIDONET file sites (ask in FIDONET 4DOS for your nearest one) and try
  363.     them yourself, since they are available on a try-before-you-buy basis.
  364.  
  365.     The filenames to look out for are 4DOS55A.ZIP, 4DOS55B.ZIP,
  366.     4OS232A.ZIP, 4OS225B.ZIP, and JP4REF.ZIP.  Full OS/2 installation
  367.     instructions for 4DOS and 4OS2 are contained in the package.
  368.  
  369.  
  370.   Configuration
  371.   ─────────────
  372.  
  373.   ■ Do I need the Windows permanent swap file, 386SPART.PAR ?
  374.  
  375.     No.  When Windows is run in OS/2, all swapping is done by OS/2 to its
  376.     own (dynamically sized) swapfile, because OS/2 handles all memory
  377.     management.  The Windows permanent swapfile may be deleted, since it
  378.     is just taking up valuable disc space for nothing.
  379.  
  380.  
  381.   ■ What is WINDOS.COM ?
  382.  
  383.     OS/2 needs to adjust the Windows kernel "on the fly" in order to make
  384.     it use an external DPMI server (i.e.  OS/2) for its DOS extender.  It
  385.     does this by using its own loader program, WIN.COM, to start the
  386.     Windows kernel on top of the VDM kernel.  The loader program for
  387.     running the Windows kernel on top of a raw DOS kernel, that is
  388.     supplied with Windows itself, is renamed to WINDOS.COM.
  389.  
  390.     When the OS/2-supplied WIN.COM detects that it is running on raw DOS
  391.     (as will happen in Dual Boot setups), it simply executes WINDOS.COM,
  392.     and the Windows kernel is loaded using the DPMI server built-in to
  393.     Windows for its DOS extender.
  394.  
  395.  
  396.   ■ What is SuperFAT ?    Is that like FAT ?
  397.  
  398.     SuperFAT is a superset of the old FAT filesystem format.  It includes
  399.     extra facilities for the storage of extended attributes for files.
  400.     The "EA DATA. SF" file in the root directory may look like a normal
  401.     file, and appears that way when using DOS+Windows (which expects the
  402.     old FAT format), but in fact it is maintained by the SuperFAT
  403.     filesystem driver to contain EA data for all files on the partition.
  404.  
  405.     You cannot delete "EA DATA. SF" by the way, because when a file is
  406.     deleted the SuperFAT filesystem driver opens "EA DATA. SF" to delete
  407.     any extended attributes for the file.  When you try to delete "EA
  408.     DATA. SF" itself, it is found to be already open, and the delete
  409.     operation fails.
  410.  
  411.     In other words, leave "EA DATA. SF" alone.
  412.  
  413.     Contrary to popular belief, the "WP ROOT. SF" file is not part of the
  414.     SuperFAT format.  It is maintained by Workplace Shell, not OS/2
  415.     itself, and stores some WPS desktop settings for each drive.  If you
  416.     delete "WP DATA. SF", Workplace Shell will re-create it next time
  417.     that you use WPS to access that drive.
  418.  
  419.  
  420.   ■ Should I choose HPFS or SuperFAT ?
  421.  
  422.     If you are free to make a choice, then HPFS is much the better choice.
  423.     It supports long filenames; it can handle partition sizes up to two
  424.     Terabytes; and especially it doesn't have the ridiculously large
  425.     cluster overheads when used on large partitions that SuperFAT does.
  426.  
  427.     Most importantly, perhaps, is that HPFS is more recoverable than
  428.     SuperFAT.  There is a lot more redundancy in the filesystem structure
  429.     for HPFS, and CHKDSK is thus far more capable of recovering lost data
  430.     on HPFS partitions in the event of errors or dirty shutdowns.
  431.  
  432.     For the full HPFS/FAT discussion, and incidental discussions covering
  433.     partition size limitations, there are separate FGAs available in the
  434.     FIDONET OS2 echo covering these subjects.
  435.  
  436.  
  437.   ■ Can I switch to HPFS without repartitioning ?
  438.  
  439.     Well, yes and no.  You must repartition, because HPFS is a different
  440.     partition type to SuperFAT.  However, if you do not wish to lose data,
  441.     then you may wish to investigate Partition Magic, which is a
  442.     commercially available utility designed to enable you to alter the
  443.     partitioning of your hard disc without losing data.
  444.  
  445.     Alternatively, you could take the opportunity to ensure that you have
  446.     proper off-line backups of all of your data.
  447.  
  448.  
  449.   ■ Can DOS and DOS+Windows programs run from and use HPFS ?
  450.  
  451.     When running under OS/2, yes, of course they can.  Any partition that
  452.     OS/2 can read natively is available to DOS and Windows applications
  453.     running on OS/2, and will look like just another drive letter.    This
  454.     covers HPFS, CD-ROM filesystems, and even network drives.
  455.  
  456.     Unfortunately, the 8.3 filename limit is hard-coded into the vast
  457.     majority of DOS and Windows applications, so they won't be able to
  458.     "see" any filenames that are not in that format on partitions that
  459.     support long filenames (such as HPFS, NETWARE and LAN SERVER
  460.     filesystems).
  461.  
  462.     Many OS/2 users are happily running their DOS and DOS+Windows
  463.     applications on all-HPFS systems.
  464.  
  465.  
  466.   ■ Should I use Dual Boot or Boot Manager ?
  467.  
  468.     Again, if you are free to make a choice, then Boot Manager is the way
  469.     to go.    Not only does it give you more flexibility (it allows you boot
  470.     from partitions on your secondary disc units), but it also protects
  471.     you from yourself to some extent.
  472.  
  473.     The dangers of Dual Boot are twofold.  Firstly, it plays musical
  474.     chairs with your boot sector and configuration files every time that
  475.     you switch operating systems.  This can, and does, cause confusion.
  476.     Virus detection softwares that checksum the boot sector will go barmy
  477.     every time that you use Dual Boot.
  478.  
  479.     Secondly, Dual Boot tacitly encourages the mistaken belief that it is
  480.     all right to run DOS disc maintenance programs on an OS/2 SuperFAT
  481.     boot partition.  Apart from the considerations mentioned in another
  482.     answer, even simply using some versions of DOS to manipulate files and
  483.     directories on SuperFAT partitions can mess up EA pointers (Novell DOS
  484.     file passwords will corrupt EA information on SuperFAT partitions, for
  485.     example).
  486.  
  487.  
  488.   ■ What can I do to `tune' OS/2 in general ?
  489.  
  490.     Chris Johnson of 1:208/610.0 maintains a list of "Performance Tips for
  491.     Power Users".  Currently this is not yet available for File Request,
  492.     but if you netmail him at that address he should be happy to netmail
  493.     you a copy.
  494.  
  495.     There are other documents and tools widely available that detail the
  496.     settings in CONFIG.SYS, although no information on their whereabouts
  497.     was available at the time of going to press.  If you have such a
  498.     document, please netmail the details to the FGA maintainer for
  499.     inclusion here.
  500.  
  501.  
  502.   Hardware and drivers
  503.   ────────────────────
  504.  
  505.   ■ My soundblaster doesn't work from Windows under OS/2!
  506.  
  507.     The SoundBlaster drivers that shipped with Windows 3.1x are the ones
  508.     that were available several years ago.    They had bugs in.  In
  509.     particular, the Voyetra MIDI drivers as supplied with Windows 3.1x
  510.     will not work under OS/2.  You can obtain updated versions of these
  511.     drivers from Creative Labs BBS or via Creative Labs Tech Support.
  512.  
  513.     You should also note two further things.
  514.  
  515.     Firstly, the DOS+Windows SoundBlaster drivers are written assuming
  516.     that they are running on a bare DOS machine.  This means that when
  517.     they initialise (i.e.  each time that a Windows VDM starts), they
  518.     reset the sound hardware.  If your soundblaster is on a non-standard
  519.     port or interrupt, you *may* (depending from your exact hardware
  520.     configuration) need to run a utility from AUTOEXEC.BAT (which runs
  521.     every time that a VDM starts) to reconfigure your SoundBlaster.
  522.  
  523.     Usually you will be using the OS/2 Multimedia SoundBlaster drivers, of
  524.     course.
  525.  
  526.     Secondly, the SB hardware was not designed to be used by more than one
  527.     thing at once.    If OS/2 is playing sounds, Windows within OS/2 will
  528.     not be able to, and vice versa.  OS/2's multitasking is nice, but it
  529.     doesn't magically cure hardware deficiencies.
  530.  
  531.     Sound hardware like the PAS16 can be used from OS/2 and Windows under
  532.     OS/2 simultaneously, because it contains two sets of circuitry.
  533.     Configure Windows to use the SoundBlaster circuitry, and OS/2 to use
  534.     the PAS circuitry.
  535.  
  536.  
  537.   ■ I cannot get MSCDEX to work under OS/2!
  538.  
  539.     You're doing things wrong.    MSCDEX is the DOS way of doing things.
  540.     OS/2 has proper native protected mode device drivers for accessing
  541.     CD-ROM devices.  Just go into Selective Install and install them, and
  542.     all applications under OS/2 will be able to see your CD-ROM.
  543.  
  544.     It used to be the case that some popular CD-ROM drives (mainly those
  545.     with proprietary non-SCSI interfaces) did not have OS/2 device
  546.     drivers.  This was back in 1993, though.  OS/2 now has device drivers
  547.     for the vast majority of CD-ROM drives.  With WARP, they come right in
  548.     the box, and they are also available as packs from the various
  549.     manufacturers for users of older versions of OS/2.
  550.  
  551.     For DOS programs, access to files on CD-ROM will be through normal
  552.     filesystem calls, which will be routed to OS/2, and the OS/2 CD-ROM
  553.     device drivers.  Access to audio services, which is the other half of
  554.     what MSCDEX does for raw DOS, is provided by the VCDROM.SYS virtual
  555.     device driver, which is installed automatically when you install
  556.     CD-ROM support.
  557.  
  558.     The only DOS program that cannot use CD-Audio without MSCDEX is
  559.     Terminate.    Bo is checking for MSCDEX incorrectly, apparently.
  560.     Complain to him to get it fixed, or just ignore the CD features of
  561.     Terminate (why does a terminal program need this stuff anyway?) and
  562.     use the native OS/2 CD-Audio players.
  563.  
  564.     ( Before the advent of the CD-ROM device drivers in late 1993, the
  565.     Frequently Given Answer for MSCDEX use to explain at great length all
  566.     about how MSCDEX is one of the most ill-behaved DOS programs ever,
  567.     since it hooks into all sorts of version-specific back doors in the
  568.     DOS kernel, and how it is possible to patch it to skip the version
  569.     check.    That is now not the best answer to the question.  )
  570.  
  571.  
  572.   Programming
  573.   ───────────
  574.  
  575.   ■ How do I detect when my DOS programs are running under OS/2 ?
  576.  
  577.     The official method has always been to check the DOS version number.
  578.     OS/2 returns version numbers that are greater than 9. DOS version 20.x
  579.     is OS/2 version 2.x, for instance.    You should always check that the
  580.     version number is greeater than or equal to a given number, and never
  581.     for an exact match.
  582.  
  583.     This only works in a VDM, naturally, since a VMB runs a real DOS
  584.     kernel, which will report its real version number.    There is no
  585.     reliable way to determine that you are running in a VMB.
  586.  
  587.  
  588.   ■ How do I release timeslices under OS/2 ?
  589.  
  590.     The call that you want is the standard INT 0x2F AX=0x1680 call, which
  591.     will release timeslices back to OS/2.  Only use this call when your
  592.     program is really doing nothing other than polling, though.  Rely on
  593.     the OS/2 scheduler to determine a priority for the VDM when your
  594.     program is actually doing useful work.  It almost always gets things
  595.     right, and second guessing it usually makes things worse, not better.
  596.  
  597.     Thank you for writing OS/2 friendly DOS programs.  Please take the
  598.     next step and write proper native OS/2 programs.  The people in the
  599.     FIDONET OS2PROG echo will be happy to help you with porting.
  600.  
  601.  
  602.   ■ Anything else that I can do from DOS programs running under OS/2 ?
  603.  
  604.     Well, yes.    A lot of the old 16-bit OS/2 API is available via
  605.     semi-documented calls from within VDMs.  You can find a list of them
  606.     in Ralph Brown's interrupt list.
  607.  
  608.     But this is really making life too complex for yourself.  If you want
  609.     to take advantage of OS/2 facilities such as semaphores and named
  610.     pipes, then write a native OS/2 program.  The API is much easier to
  611.     call than messy DOS interrupts, and is exceedingly well documented.
  612.     There are a wide range of languages available for OS/2, from C++ to
  613.     FORTH, as well.
  614.  
  615.  
  616.   Technical Concepts
  617.   ──────────────────
  618.  
  619.   ■ How does OS/2 support DOS and DOS+Windows applications ?
  620.  
  621.     A normal OS/2 process runs in protected mode, and sees a simple, flat,
  622.     linear virtual memory space, which can be up to 512Mb.    However, OS/2
  623.     can use the v8086 protected mode of the 386/486/586 CPUs to emulate
  624.     the environment and memory map that an ordinary DOS application would
  625.     see.  This is what allows DOS and DOS+Windows applications to run
  626.     under OS/2.
  627.  
  628.     Extended DOS applications usually run in `normal' protected mode, very
  629.     similar to normal OS/2 processes, in fact, except DOS extenders expect
  630.     the bottom megabyte of the virtual address space to contain a DOS
  631.     environment.  OS/2 acts as a DOS Protected Mode Interface (DPMI)
  632.     server, to allow DOS programs to switch between normal and v8086
  633.     protected mode, and to manage memory in both.
  634.  
  635.     The Windows kernel itself is architecturally no more than a DPMI DOS
  636.     extender.  Windows applications run in normal protected mode, but rely
  637.     on the underlying DOS services for things like file access.  Windows
  638.     uses the DOS Protected Mode Interface to switch back and forth between
  639.     normal protected mode and v8086 mode in order to service DOS calls
  640.     from Windows applications.
  641.  
  642.  
  643.   ■ What about virtual memory ?
  644.  
  645.     The memory map of a v8086 protected mode process has the same
  646.     conventional/upper/high/extended memory map that a machine actually
  647.     booted into DOS has.  However, all of this is in fact virtual memory.
  648.     OS/2 pages the memory of any and all v8086 processes to and from disc
  649.     transparently.    DOS and DOS+Windows applications are unaware of this.
  650.  
  651.     Unlike DOS+Windows, under OS/2 the address spaces of all v8086
  652.     processes are entirely distinct.  This prevents one session from
  653.     interfering with another, and also allows multiple sessions to be
  654.     configured differently.
  655.  
  656.  
  657.   ■ What are VDMs and VMBs ?
  658.  
  659.     Both VDMs and VMBs are OS/2 processes, and use normal OS/2 services.
  660.     However, they rely on translation layers to convert DOS services
  661.     requested by DOS or DOS+Windows applications into calls to OS/2
  662.     services.
  663.  
  664.     A Virtual DOS Machine is colloquially known as "a DOS session", and is
  665.     where OS/2 emulates the complete DOS environment, including all DOS
  666.     services.  It uses a built-in version of the DOS kernel, that maps
  667.     most DOS services directly onto their OS/2 equivalents.
  668.  
  669.     A Virtual Machine Boot only emulates the BIOS portion of a DOS
  670.     environment, and `boots' a real DOS kernel on top.    This kernel is
  671.     either an actual disc partition, a floppy disc, or an image file of
  672.     a disc partition or floppy disc.
  673.  
  674.  
  675.   ■ When would I need a VMB instead of a VDM, and how do I go about
  676.     creating one ?
  677.  
  678.     It is rare that you would need a VMB.  The main reason for needing a
  679.     VMB is when a program requires access to the undocumented internals of
  680.     the DOS kernel.  Since the DOS kernel used in a VDM merely translates
  681.     DOS services to OS/2 services, many of the undocumented internals of
  682.     the DOS kernel are absent.    Programs that rely on these internals
  683.     require a `vanilla' DOS kernel, hence the reason for VMBs.
  684.  
  685.     Fortunately, such programs are very rare.  The most common ones are
  686.     DOS client networking softwares, and in most cases it is often simpler
  687.     to obtain the OS/2 client versions of the softwares (most networks,
  688.     including Netware and LANTastic, supply OS/2 client softwares, often
  689.     as part of the package).
  690.  
  691.     To create a VMB, you simply change the DOS_STARTUP setting in the VDM
  692.     settings for that program object to point either to a driver letter or
  693.     to an image file.
  694.  
  695.     To find out how to create an image file, read both the section in the
  696.     Master Help Index entitled "starting a specific version of DOS", and
  697.     the on-line help in the Command Reference under VMDISK.
  698.  
  699.  
  700.   ■ What is the VMM and what are VDDs ?
  701.  
  702.     The Virtual Machine Manager is the part of the OS/2 kernel that
  703.     handles setting up the v8086 process itself, and administering the
  704.     Virtual Device Drivers and, if necessary, the built-in VDM kernel.
  705.  
  706.     Virtual Device Drivers are in control of emulating hardware and device
  707.     services for a VDM or VMB.    The VCOM.SYS virtual device driver, for
  708.     example, emulates the physical UART hardware in each VDM/VMB,
  709.     translating all low level UART accesses into normal OS/2 API accesses
  710.     to the COM device.
  711.  
  712.     Virtual Device Drivers are in fact what provide and interpret the "VDM
  713.     settings" that you see in the settings dialogue on the desktop.
  714.  
  715.     For more information on VDDs and the internals of a VDM/VMB, consult
  716.     the Virtual Device Driver Reference published by IBM, which can be
  717.     found (along with a whole heap of other technical reference books) in
  718.     electronic form on the OS/2 Online Book Collection CD-ROM (IBM part
  719.     number 53G2166, costing roughly £30).
  720.  
  721.  
  722. ─────
  723. (c) Copyright 1995.  All Rights Reserved.
  724. Permission is hereby granted to redistribute this document in original
  725. form without modification, as long as no fee is charged, and as long as
  726. you realise that I take no responsibility whatsoever for what it does to
  727. your machine, data, cat, or marital status.
  728.  
  729. Jonathan de Boyne Pollard
  730. Moderator, International FIDONET OS2DOS echo
  731. FIDONET 2:440/4.3
  732.